package palindrome;

/**
 * This class will check a string to see whether it is a Palindrome or not.
 * 
 * <p>For more details of Palindrome, refer to:
 * {@link http://en.wikipedia.org/wiki/Palindrome}
 * </p>
 *
 */

public  class PalindromeChecker {
    
    public static enum PharseCheckMode {
        CHAR_BY_CHAR,
        INCLUDING_SPACES,
        ONLY_ALPHABET_AND_NUMBERS,        
    }

    public static boolean isPalindromeWord(String word) {
        
        char[] chars = word.toCharArray();
        
        int length = chars.length - 1;       
        
        for (int pivot = length / 2; pivot >= 0; pivot--) {
            if (chars[pivot] != chars[length - pivot]) {
                return false;
            }
        }       
        
        return true;
    }
    
    public static boolean isPalindromePhrase(String phrase, PharseCheckMode mode) {
        return false;
    }
    
    
}
